<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            max-width: 400px;
            min-height: 400px;
        }

        #nav{

            position: fixed;
            right: 100px;
            bottom: 50%;
            width: 300px;
            height: 300px;
        }
        #nav a{
            text-decoration: none;
            color: black;
            display: block;
            padding: 10px;
            font-size: 40px;
            margin-top: 10px;
        }
        #nav a:hover{
            color: gray;
        }
        .display{
            position: fixed;
            background-color: rgba(0,0,0,0.9);
            display: flex;
            justify-content: center;
            vertical-align: middle;
            object-fit: contain;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
         
        }
        .display img{
           min-width: 600px; 
           
        }
       
    </style>
</head>
<body>
    <div id="nav">
        <h1>点击下面可定位，图片可点击</h1>
        <a href="#beauty">美女</a>
        <a href="#boy">型男</a>
        <a href="#businessman">企业家</a>
        <a href="#scientist">伟大的科学家</a>
        <a href="../index.html">点击回到首页</a>
        <h1>播放音乐,有更好体验</h1>
        <audio src="./image/music.mp4" controls autoplay></audio>
        
    </div>
    <h1 id="beauty">美女</h1>
    <img src="./image/beauty1.jpg" alt="" class="img" onclick="onk()">
    <img src="./image/beauty2.jpg" alt="" class="img" onclick="onk()">
    <h1 id="boy">型男</h1>
    <img src="./image/boy1.jpeg" alt="" class="img">
    <img src="./image/boy2.jpg" alt="" class="img">
    <h1 id="businessman">企业家</h1>
    <img src="./image/businessman1.jpg" alt="" class="img">
    <img src="./image/businessman2.jpeg" alt="" class="img">
    <h1 id="scientist">伟大的科学家</h1>
    <img src="./image/scientist1.jpeg" alt="" height="500px" class="img">
    <img src="./image/scientist2.jpg" alt="" height="500px" class="img">
    <h1>袁隆平相关视频</h1>
    <video controls src="./image/mda-qchf9h407xqzx9wt.mp4"></video>
    <script>
        var imglist = document.getElementsByTagName("img");
        for(let img of imglist){
            img.addEventListener("click",()=>{
                let div_display = document.createElement("div");
                div_display.onclick=function(){
                    div_display.remove()
                }
                div_display.classList.add("display");
                let imgbig = document.createElement("img")
                imgbig.src = img.src;
                div_display.append(imgbig)
                document.body.append(div_display)
            })
        }
        
        
    </script>
</body>
</html>